using RimWorld;
using RimWorld.Planet;

namespace TW_Rainbow_Land {

    public class BiomeWorker_Rainbow : BiomeWorker
    {
        public override float GetScore(BiomeDef biome, Tile tile, PlanetTile planetTile)
        {
            if (tile.WaterCovered)
            {
                return -100f;
            }

            if (tile.temperature < 10f || tile.temperature > 55f)
            {
                return 0f;
            }

            if (tile.rainfall < 800f || tile.rainfall > 900f)
            {
                return 0f;
            }

            if (tile.swampiness < 0.2f)
            {
                return 0f;
            }

            return 23f + (tile.temperature - 7f) + (tile.rainfall - 920f) / 220f + tile.swampiness * 2.7f;
        }
    }
}